#include<iostream>
using namespace std;

class Person
{
private:
  /* data */
public:
  string name;
  int age;
};

struct Dog {
  string name;
  int age;
};

int main() {
  Person p1 = { "xl", 31 };
  // p1.name = "xl";
  // p1.age = 31;

  // 虽然我在Person类中并没有定义拷贝构造函数，但是编译器会默认拷贝构造函数(对属性进行值拷贝)
  Person p2(p1);
  cout << p2.age << endl;

  Dog dog1 = { "xx", 2 };
  cout << dog1.name << endl;
  return 0;
}